

<%@page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>

<%@taglib prefix="jstl" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@taglib prefix="security"
	uri="http://www.springframework.org/security/tags"%>
<%@taglib prefix="display" uri="http://displaytag.sf.net"%>
<%@taglib prefix="acme" tagdir="/WEB-INF/tags"%>

<form:form action="${requestURI}" modelAttribute="routeForm">
	

	
	<form:hidden path="eventId"/>

	<jstl:if test="${isNew}">
		<acme:textbox code="route.name" path="name" />
		<acme:textbox code="route.length" path="length" />
		<acme:textbox code="route.difficulty" path="difficulty" />
	</jstl:if>

	<jstl:if test="${!isNew}">
		<acme:textbox code="route.name" path="name" readonly="true" />
		<acme:textbox code="route.length" path="length" readonly="true" />
		<acme:textbox code="route.difficulty" path="difficulty" readonly="true" />
	</jstl:if>

	<security:authorize access="hasRole('ADMINISTRATOR')">
		<jstl:if test="${!isNew}">
			<acme:textbox code="route.rating" path="rating" readonly="true" />
		</jstl:if>

		<jstl:if test="${isOwner && isNew}">
			<acme:submit code="route.save" name="save" />
		</jstl:if>
		
		<acme:cancel code="route.cancel" url="${backURI}" />

	</security:authorize>

	<security:authorize access="hasRole('PARTICIPANT')">

		<acme:textbox code="route.rating" path="rating" readonly="true" />
		<acme:cancel code="route.cancel" url="${backURI}" />
		<acme:cancel code="event.assess"
			url="assess/participant/create.do?routeId=" />
	</security:authorize>
</form:form>



